<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>调用Android组件测试</title>

    <script>

        // 详情
        function XQ() {
            if (_IsIOS()) {

                window.webkit.messageHandlers.method.postMessage("123","345");

            } else if (_IsAndroid()) {
                window.control.method("123","345")
            }
        }

        // 购物
        function Gw() {
            if (_IsIOS()) {

                window.webkit.messageHandlers.method.postMessage(shopid, goodsid);

            } else if (_IsAndroid()) {
                window.myobj.showAndroid("123")
            }
        }

        //判断是否ios访问
        function _IsIOS() {
            if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {
                return true;
            } else {
                return false;
            }
        }

        //判断是否android访问
        function _IsAndroid() {
            if (/(Android|Adr)/i.test(navigator.userAgent)) {
                return true;
            } else {
                return false;
            }
        }

        $("li span").click(function () {
            layer.open({
                type: 0,
                content: 'Hello',
                style: 'font-size: 16px',
                time: 3
            });
        })

    </script>
</head>

<body>
<b>测试</b>
<br />
<button onClick="window.control.method('123','345')">启动hello world Activity</button>
<br />
<hr  color="#99FF00"/>
<button onClick="XQ()">显示android内容</button>
<br />
<textarea id= "shows"  cols="20" rows="10"> 暂无记录 </textarea>
<br />

</body>
</html>